﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：QS_JX_BUMENXX实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class QS_JX_BUMENXX
    {
        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_tuoshou;

        private decimal? m_dec_i_watertype;

        private decimal m_dec_id;

        private DateTime? m_DT_d_caozuorq;

        private DateTime? m_DT_d_tianjiarq;

        private string m_str_s_beizhu;

        private string m_str_s_bumen_guid;

        private string m_str_s_bumenbh;

        private string m_str_s_bumenmc;

        private string m_str_s_caozuor;

        private string m_str_s_dizhi;

        private string m_str_s_kaihuhm;

        private string m_str_s_kaihuyh;

        private string m_str_s_kaihuzh;

        private string m_str_s_lianxibm;

        private string m_str_s_lianxidh;

        private string m_str_s_lianxir;

        private string m_str_s_tianjiar;

        private string m_str_s_yewuy_guid;

        private string m_str_s_youbian;

        /// <summary>
        ///     主键
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     主管部门guid。CompanyGuid
        /// </summary>
        public string S_BUMEN_GUID
        {
            get { return m_str_s_bumen_guid; }
            set { m_str_s_bumen_guid = value; }
        }

        /// <summary>
        ///     主管部门编号
        /// </summary>
        public string S_BUMENBH
        {
            get { return m_str_s_bumenbh; }
            set { m_str_s_bumenbh = value; }
        }

        /// <summary>
        ///     部门名称
        /// </summary>
        public string S_BUMENMC
        {
            get { return m_str_s_bumenmc; }
            set { m_str_s_bumenmc = value; }
        }

        /// <summary>
        ///     邮编
        /// </summary>
        public string S_YOUBIAN
        {
            get { return m_str_s_youbian; }
            set { m_str_s_youbian = value; }
        }

        /// <summary>
        ///     地址
        /// </summary>
        public string S_DIZHI
        {
            get { return m_str_s_dizhi; }
            set { m_str_s_dizhi = value; }
        }

        /// <summary>
        ///     联系人
        /// </summary>
        public string S_LIANXIR
        {
            get { return m_str_s_lianxir; }
            set { m_str_s_lianxir = value; }
        }

        /// <summary>
        ///     联系部门
        /// </summary>
        public string S_LIANXIBM
        {
            get { return m_str_s_lianxibm; }
            set { m_str_s_lianxibm = value; }
        }

        /// <summary>
        ///     联系电话
        /// </summary>
        public string S_LIANXIDH
        {
            get { return m_str_s_lianxidh; }
            set { m_str_s_lianxidh = value; }
        }

        /// <summary>
        ///     业务员guid
        /// </summary>
        public string S_YEWUY_GUID
        {
            get { return m_str_s_yewuy_guid; }
            set { m_str_s_yewuy_guid = value; }
        }

        /// <summary>
        ///     是否托收 1托收
        /// </summary>
        public decimal? I_TUOSHOU
        {
            get { return m_dec_i_tuoshou; }
            set { m_dec_i_tuoshou = value; }
        }

        /// <summary>
        ///     开户户名
        /// </summary>
        public string S_KAIHUHM
        {
            get { return m_str_s_kaihuhm; }
            set { m_str_s_kaihuhm = value; }
        }

        /// <summary>
        ///     开户银行
        /// </summary>
        public string S_KAIHUYH
        {
            get { return m_str_s_kaihuyh; }
            set { m_str_s_kaihuyh = value; }
        }

        /// <summary>
        ///     开户账号
        /// </summary>
        public string S_KAIHUZH
        {
            get { return m_str_s_kaihuzh; }
            set { m_str_s_kaihuzh = value; }
        }

        /// <summary>
        ///     备注说明
        /// </summary>
        public string S_BEIZHU
        {
            get { return m_str_s_beizhu; }
            set { m_str_s_beizhu = value; }
        }

        /// <summary>
        ///     用水类别
        /// </summary>
        public decimal? I_WATERTYPE
        {
            get { return m_dec_i_watertype; }
            set { m_dec_i_watertype = value; }
        }

        /// <summary>
        ///     记录状态0正常
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        ///     添加人
        /// </summary>
        public string S_TIANJIAR
        {
            get { return m_str_s_tianjiar; }
            set { m_str_s_tianjiar = value; }
        }

        /// <summary>
        ///     添加时间
        /// </summary>
        public DateTime? D_TIANJIARQ
        {
            get { return m_DT_d_tianjiarq; }
            set { m_DT_d_tianjiarq = value; }
        }

        /// <summary>
        ///     操作人
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }

        /// <summary>
        ///     操作时间
        /// </summary>
        public DateTime? D_CAOZUORQ
        {
            get { return m_DT_d_caozuorq; }
            set { m_DT_d_caozuorq = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class QS_JX_BUMENXXProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public QS_JX_BUMENXXProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据QS_JX_BUMENXX实体添加或者修改QS_JX_BUMENXX信息
        /// </summary>
        public bool InsertOrUpdate(QS_JX_BUMENXX QS_JX_BUMENXX, OracleTransaction Transaction)
        {
            if (QS_JX_BUMENXX.ID == 0)
                InsertQS_JX_BUMENXX(QS_JX_BUMENXX, Transaction);
            else
                UpdateQS_JX_BUMENXX(QS_JX_BUMENXX, Transaction);
            return QS_JX_BUMENXX.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据QS_JX_BUMENXX实体添加或修改QS_JX_BUMENXX信息
        /// </summary>
        public bool InsertOrUpdate(QS_JX_BUMENXX QS_JX_BUMENXX)
        {
            return InsertOrUpdate(QS_JX_BUMENXX, null);
        }


        /// <summary>
        ///     根据QS_JX_BUMENXX主键删除QS_JX_BUMENXX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteQS_JX_BUMENXX(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelQS_JX_BUMENXX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据QS_JX_BUMENXX主键删除QS_JX_BUMENXX信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteQS_JX_BUMENXX(decimal ID)
        {
            return DeleteQS_JX_BUMENXX(ID, null);
        }

        /// <summary>
        ///     根据条件删除QS_JX_BUMENXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteQS_JX_BUMENXXesDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelQS_JX_BUMENXXesDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除QS_JX_BUMENXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteQS_JX_BUMENXXesDynamic(string WhereClause)
        {
            return DeleteQS_JX_BUMENXXesDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据QS_JX_BUMENXX主键选择QS_JX_BUMENXX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_JX_BUMENXX信息</returns>
        public QS_JX_BUMENXX SelectQS_JX_BUMENXX(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_JX_BUMENXX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var QS_JX_BUMENXX = PopulateQS_JX_BUMENXX(rd);
                rd.Close();
                return QS_JX_BUMENXX;
            }
            return null;
        }

        /// <summary>
        ///     根据QS_JX_BUMENXX主键选择QS_JX_BUMENXX信息
        /// </summary>
        /// <returns>QS_JX_BUMENXX信息</returns>
        public QS_JX_BUMENXX SelectQS_JX_BUMENXX(decimal ID)
        {
            return SelectQS_JX_BUMENXX(ID, null);
        }

        /// <summary>
        ///     选择所有QS_JX_BUMENXX信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有QS_JX_BUMENXX信息</returns>
        public DataTable SelectQS_JX_BUMENXXesAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_JX_BUMENXXesAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有QS_JX_BUMENXX信息
        /// </summary>
        /// <returns>所有QS_JX_BUMENXX信息</returns>
        public DataTable SelectQS_JX_BUMENXXesAll()
        {
            return SelectQS_JX_BUMENXXesAll(null);
        }

        /// <summary>
        ///     根据条件选择QS_JX_BUMENXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_JX_BUMENXX信息</returns>
        public DataTable SelectQS_JX_BUMENXXesDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_JX_BUMENXXesDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择QS_JX_BUMENXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>QS_JX_BUMENXX信息</returns>
        public DataTable SelectQS_JX_BUMENXXesDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectQS_JX_BUMENXXesDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择QS_JX_BUMENXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>QS_JX_BUMENXX信息</returns>
        public DataTable SelectQS_JX_BUMENXXesDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelQS_JX_BUMENXXesDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择QS_JX_BUMENXX信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>QS_JX_BUMENXX信息</returns>
        public DataTable SelectQS_JX_BUMENXXesDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectQS_JX_BUMENXXesDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新QS_JX_BUMENXX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateQS_JX_BUMENXXesDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdQS_JX_BUMENXXDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新QS_JX_BUMENXX字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateQS_JX_BUMENXXesDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateQS_JX_BUMENXXesDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertQS_JX_BUMENXX(QS_JX_BUMENXX QS_JX_BUMENXX, OracleTransaction Transaction)
        {
            var spName = "CS_InsQS_JX_BUMENXX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = QS_JX_BUMENXX.S_BUMEN_GUID;
            storedParams[1].Value = QS_JX_BUMENXX.S_BUMENBH;
            storedParams[2].Value = QS_JX_BUMENXX.S_BUMENMC;
            storedParams[3].Value = QS_JX_BUMENXX.S_YOUBIAN;
            storedParams[4].Value = QS_JX_BUMENXX.S_DIZHI;
            storedParams[5].Value = QS_JX_BUMENXX.S_LIANXIR;
            storedParams[6].Value = QS_JX_BUMENXX.S_LIANXIBM;
            storedParams[7].Value = QS_JX_BUMENXX.S_LIANXIDH;
            storedParams[8].Value = QS_JX_BUMENXX.S_YEWUY_GUID;
            storedParams[9].Value = QS_JX_BUMENXX.I_TUOSHOU;
            storedParams[10].Value = QS_JX_BUMENXX.S_KAIHUHM;
            storedParams[11].Value = QS_JX_BUMENXX.S_KAIHUYH;
            storedParams[12].Value = QS_JX_BUMENXX.S_KAIHUZH;
            storedParams[13].Value = QS_JX_BUMENXX.S_BEIZHU;
            storedParams[14].Value = QS_JX_BUMENXX.I_WATERTYPE;
            storedParams[15].Value = QS_JX_BUMENXX.I_JLZT;
            storedParams[16].Value = QS_JX_BUMENXX.S_TIANJIAR;
            storedParams[17].Value = QS_JX_BUMENXX.D_TIANJIARQ;
            storedParams[18].Value = QS_JX_BUMENXX.S_CAOZUOR;
            storedParams[19].Value = QS_JX_BUMENXX.D_CAOZUORQ;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            QS_JX_BUMENXX.ID = Convert.ToInt32(storedParams[20].Value);
            return result;
        }

        private bool UpdateQS_JX_BUMENXX(QS_JX_BUMENXX QS_JX_BUMENXX, OracleTransaction Transaction)
        {
            var spName = "CS_UpdQS_JX_BUMENXX";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = QS_JX_BUMENXX.S_BUMEN_GUID;
            storedParams[1].Value = QS_JX_BUMENXX.S_BUMENBH;
            storedParams[2].Value = QS_JX_BUMENXX.S_BUMENMC;
            storedParams[3].Value = QS_JX_BUMENXX.S_YOUBIAN;
            storedParams[4].Value = QS_JX_BUMENXX.S_DIZHI;
            storedParams[5].Value = QS_JX_BUMENXX.S_LIANXIR;
            storedParams[6].Value = QS_JX_BUMENXX.S_LIANXIBM;
            storedParams[7].Value = QS_JX_BUMENXX.S_LIANXIDH;
            storedParams[8].Value = QS_JX_BUMENXX.S_YEWUY_GUID;
            storedParams[9].Value = QS_JX_BUMENXX.I_TUOSHOU;
            storedParams[10].Value = QS_JX_BUMENXX.S_KAIHUHM;
            storedParams[11].Value = QS_JX_BUMENXX.S_KAIHUYH;
            storedParams[12].Value = QS_JX_BUMENXX.S_KAIHUZH;
            storedParams[13].Value = QS_JX_BUMENXX.S_BEIZHU;
            storedParams[14].Value = QS_JX_BUMENXX.I_WATERTYPE;
            storedParams[15].Value = QS_JX_BUMENXX.I_JLZT;
            storedParams[16].Value = QS_JX_BUMENXX.S_TIANJIAR;
            storedParams[17].Value = QS_JX_BUMENXX.D_TIANJIARQ;
            storedParams[18].Value = QS_JX_BUMENXX.S_CAOZUOR;
            storedParams[19].Value = QS_JX_BUMENXX.D_CAOZUORQ;
            storedParams[20].Value = QS_JX_BUMENXX.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private QS_JX_BUMENXX PopulateQS_JX_BUMENXX(IDataReader dr)
        {
            var QS_JX_BUMENXX = new QS_JX_BUMENXX();
            QS_JX_BUMENXX.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            QS_JX_BUMENXX.S_BUMEN_GUID = dr["S_BUMEN_GUID"] == DBNull.Value ? null : (string) dr["S_BUMEN_GUID"];
            QS_JX_BUMENXX.S_BUMENBH = dr["S_BUMENBH"] == DBNull.Value ? null : (string) dr["S_BUMENBH"];
            QS_JX_BUMENXX.S_BUMENMC = dr["S_BUMENMC"] == DBNull.Value ? null : (string) dr["S_BUMENMC"];
            QS_JX_BUMENXX.S_YOUBIAN = dr["S_YOUBIAN"] == DBNull.Value ? null : (string) dr["S_YOUBIAN"];
            QS_JX_BUMENXX.S_DIZHI = dr["S_DIZHI"] == DBNull.Value ? null : (string) dr["S_DIZHI"];
            QS_JX_BUMENXX.S_LIANXIR = dr["S_LIANXIR"] == DBNull.Value ? null : (string) dr["S_LIANXIR"];
            QS_JX_BUMENXX.S_LIANXIBM = dr["S_LIANXIBM"] == DBNull.Value ? null : (string) dr["S_LIANXIBM"];
            QS_JX_BUMENXX.S_LIANXIDH = dr["S_LIANXIDH"] == DBNull.Value ? null : (string) dr["S_LIANXIDH"];
            QS_JX_BUMENXX.S_YEWUY_GUID = dr["S_YEWUY_GUID"] == DBNull.Value ? null : (string) dr["S_YEWUY_GUID"];
            QS_JX_BUMENXX.I_TUOSHOU = dr["I_TUOSHOU"] == DBNull.Value ? null : (decimal?) dr["I_TUOSHOU"];
            QS_JX_BUMENXX.S_KAIHUHM = dr["S_KAIHUHM"] == DBNull.Value ? null : (string) dr["S_KAIHUHM"];
            QS_JX_BUMENXX.S_KAIHUYH = dr["S_KAIHUYH"] == DBNull.Value ? null : (string) dr["S_KAIHUYH"];
            QS_JX_BUMENXX.S_KAIHUZH = dr["S_KAIHUZH"] == DBNull.Value ? null : (string) dr["S_KAIHUZH"];
            QS_JX_BUMENXX.S_BEIZHU = dr["S_BEIZHU"] == DBNull.Value ? null : (string) dr["S_BEIZHU"];
            QS_JX_BUMENXX.I_WATERTYPE = dr["I_WATERTYPE"] == DBNull.Value ? null : (decimal?) dr["I_WATERTYPE"];
            QS_JX_BUMENXX.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            QS_JX_BUMENXX.S_TIANJIAR = dr["S_TIANJIAR"] == DBNull.Value ? null : (string) dr["S_TIANJIAR"];
            QS_JX_BUMENXX.D_TIANJIARQ = dr["D_TIANJIARQ"] == DBNull.Value ? null : (DateTime?) dr["D_TIANJIARQ"];
            QS_JX_BUMENXX.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            QS_JX_BUMENXX.D_CAOZUORQ = dr["D_CAOZUORQ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUORQ"];
            return QS_JX_BUMENXX;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion